Text
Displays text.
component Text
import { Text } from ui
export var main = Text("Hello, world!")
Constructor
_ text: String
The text to display
color: Color? = nil
The text's color.
Inherited from environment, if set to nil
. The root environment defines the text color black.
See Color
size: Int? = nil
The text's size in pixels.
Inherited from environment, if set to nil
. The root environment defines the font size 16.
font_family: FontFamilyName? = nil
The font family.
Inherited from environment, if set to nil
. The root environment defines the font family Roboto.
See FontFamilyName See load_font
italic: Bool = false
Enables the italic style.
font_weight: Int = font_weights.normal
Font weight.
See font_weights
line_limit: Int? = nil
The maximum number of lines the text can be broken onto.
Inherited from environment, if set to nil
. The root environment defines the line limit max_integer.
multiline_alignment: HorizontalAlignment? = nil
The alignment of the individual lines when text breaks.
Inherited from environment, if set to nil
. The root environment defines the multiline alignment center.
Layout Behavior
Tries to occupy the exact space needed to display the text. If the horizontal space isn't enough it will try to wrap the lines vertical until everything is displayed or no more space is left. As a last resort, the text is elided to fit into the available space.
Text will never use more space than needed.